FROM php:7.2.26-fpm
MAINTAINER Aaron Woo "707230686@qq.com"
ADD sources.list /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y nginx
RUN pecl install swoole
RUN echo "extension=swoole.so" > /usr/local/etc/php/conf.d/swoole.ini
# Create the default data directory
RUN mkdir -p /site
RUN apt-get install -y \
        vim \
        zlib1g=1:1.2.8.dfsg-2+b1 \
        zlib1g-dev \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libmcrypt-dev \
        libpng12-dev \
        openssl libssh-dev \
        libnghttp2-dev \
        libhiredis-dev
# Install php extension monogodb
RUN pecl install mongodb
RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/monogodb.ini
# Install supervisor
RUN apt-get install -y supervisor
RUN mkdir -p /etc/supervisor.conf.d && \
	mkdir -p /var/log/supervisor
RUN apt-get install net-tools
# Install php extensions
RUN docker-php-ext-configure gd \
        --with-gd \
        --with-freetype-dir=/usr/include/ \
        --with-png-dir=/usr/include/ \
        --with-jpeg-dir=/usr/include/ \
        && docker-php-ext-install gd \
        && docker-php-ext-enable gd \
        && docker-php-ext-install pdo_mysql
RUN docker-php-ext-install opcache
# Install php extension php-bcmath
RUN docker-php-ext-install bcmath
RUN pecl install xdebug-2.6.0 \
	&& docker-php-ext-enable xdebug
RUN pecl install redis \
        echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini
RUN pecl install apcu \
        echo "extension=apcu.so" > /usr/local/etc/php/conf.d/apcu.ini
RUN docker-php-ext-install mysqli
RUN docker-php-ext-install zip
EXPOSE 80 443 9000

# Add supervisord.conf
ADD supervisord.conf /etc/supervisord.conf
ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]
